<!DOCTYPE html>
<html>
<head>
<style>
  .parent {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 200px;
    height: 200px;
    border: 1px solid black;
  }
  .child {
    width: 50px;
    height: 50px;
    background-color: red;
  }
</style>
</head>
<body>

<div class="parent">
  <div class="child"></div>
</div>

</body>
</html>